Xbasic
OBJECT.MODE_GET Function
Syntax
Mode as C = .Mode_Get()
Arguments
- Mode
Possible modes are:
- "VIEW" = 0
- "CHANGE" = 1
- "ENTER" = 2
- "QUERY" = 3
- "FIND" = 4
Description
Returns the current mode for the form or browse.
The <OBJECT>.MODE_GET() method applies to:
- Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
- Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)
The <OBJECT>.MODE_GET() method returns the current mode (VIEW, CHANGE, ENTER, QUERY, FIND) of the current window.
Example
This script is attached to a button on a layout. It saves the current record if the layout is in change or enter mode. If the layout is in Query or Find mode, it exits to View mode.
Mode = parent.mode_get() select case mode = "CHANGE" .or. mode = "ENTER" parent.commit() case mode = "QUERY" parent.query_exit() case mode = "FIND" parent.find_exit() end select
Limitations
Desktop applications only.
See Also